﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using CE.Global;

public partial class Provider_Statistics : System.Web.UI.Page
{
    string PageName = "CXVSTS";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session[CE.Global.General.UserId] == null || Session[CE.Global.General.ProviderCompanyId] == null)
        {
            Response.Redirect("~/Provider/ProviderSecureLogin.aspx");
        }
        CheckMainPageAccess();

        if (!Page.IsPostBack)
        {
            if (Session[CE.Global.General.UserId].ToString() == "54")  //local 36, live 54 hsbc dummy accnt
            {
                hlnkPA.Visible = true;
                hlnkTI.Visible = true;
            }
            else
            {
                hlnkPA.Visible = false;
                hlnkTI.Visible = false;
            }

            if ((Session[CE.Global.General.UserId].ToString() == "53") || (Session[CE.Global.General.UserId].ToString() == "55"))
            {
                //local 35, live53 chartis accnt
                //local 37, live55 liberty travel accnt
                hlnkTI.Visible = true;
                hlnkCar.Visible = false;
            }

        }
    }

    private void CheckMainPageAccess()
    {
        Int64 PageAccess = General.GetProviderMainPageAccess(Convert.ToInt64(Session[General.ProviderCompanyId].ToString()),
                                                        Convert.ToInt64(Session[General.UserId].ToString()), PageName);
        if (PageAccess == 0)
        {
            //Response.Redirect("~/Provider/UserMessage.aspx?errorcode=2000");
            Response.Redirect("~/Provider/UserMessage.aspx?mt=UM&ec=2000");
        }
    }

}
